.class public Lorg/zeam/FolderIcon;
.super Lorg/zeam/BubbleTextView;
.source "FolderIcon.java"

# interfaces
.implements Lorg/zeam/DropTarget;


# instance fields
.field private mCloseIcon:Landroid/graphics/drawable/Drawable;

.field private mInfo:Lorg/zeam/UserFolderInfo;

.field private mLauncher:Lorg/zeam/Launcher;

.field private mOpenIcon:Landroid/graphics/drawable/Drawable;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0
    .parameter "context"

    .prologue
    .line 39
    invoke-direct {p0, p1}, Lorg/zeam/BubbleTextView;-><init>(Landroid/content/Context;)V

    .line 40
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 0
    .parameter "context"
    .parameter "attrs"

    .prologue
    .line 35
    invoke-direct {p0, p1, p2}, Lorg/zeam/BubbleTextView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    .line 36
    return-void
.end method

.method static fromXml(ILorg/zeam/Launcher;Landroid/view/ViewGroup;Lorg/zeam/UserFolderInfo;)Lorg/zeam/FolderIcon;
    .locals 7
    .parameter "resId"
    .parameter "launcher"
    .parameter "group"
    .parameter "folderInfo"

    .prologue
    const/4 v6, 0x0

    .line 44
    invoke-virtual {p1}, Lorg/zeam/Launcher;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    .line 45
    .local v3, resources:Landroid/content/res/Resources;
    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v4

    const/4 v5, 0x0

    invoke-virtual {v4, p0, p2, v5}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v2

    check-cast v2, Lorg/zeam/FolderIcon;

    .line 46
    .local v2, icon:Lorg/zeam/FolderIcon;
    const v4, 0x7f020012

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v1

    .line 47
    .local v1, drawableOpen:Landroid/graphics/drawable/Drawable;
    const v4, 0x7f020011

    invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    .line 49
    .local v0, drawableClosed:Landroid/graphics/drawable/Drawable;
    invoke-static {v0, p1}, Lorg/zeam/Utilities;->createIconThumbnail(Landroid/graphics/drawable/Drawable;Landroid/content/Context;)Landroid/graphics/drawable/Drawable;

    move-result-object v4

    iput-object v4, v2, Lorg/zeam/FolderIcon;->mCloseIcon:Landroid/graphics/drawable/Drawable;

    .line 50
    iput-object v1, v2, Lorg/zeam/FolderIcon;->mOpenIcon:Landroid/graphics/drawable/Drawable;

    .line 51
    invoke-virtual {v2, v6, v0, v6, v6}, Lorg/zeam/FolderIcon;->setCompoundDrawablesWithIntrinsicBounds(Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V

    .line 52
    invoke-static {p1}, Lorg/zeam/PreferencesUtil;->isShowShortcutTitlesEnabled(Landroid/content/Context;)Z

    move-result v4

    if-eqz v4, :cond_0

    .line 53
    iget-object v4, p3, Lorg/zeam/UserFolderInfo;->title:Ljava/lang/CharSequence;

    invoke-virtual {v2, v4}, Lorg/zeam/FolderIcon;->setText(Ljava/lang/CharSequence;)V

    .line 55
    :cond_0
    invoke-virtual {v2, p3}, Lorg/zeam/FolderIcon;->setTag(Ljava/lang/Object;)V

    .line 56
    invoke-virtual {v2, p1}, Lorg/zeam/FolderIcon;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 57
    iput-object p3, v2, Lorg/zeam/FolderIcon;->mInfo:Lorg/zeam/UserFolderInfo;

    .line 58
    iput-object p1, v2, Lorg/zeam/FolderIcon;->mLauncher:Lorg/zeam/Launcher;

    .line 59
    return-object v2
.end method


# virtual methods
.method public acceptDrop(Lorg/zeam/DragSource;IIIILjava/lang/Object;)Z
    .locals 8
    .parameter "source"
    .parameter "x"
    .parameter "y"
    .parameter "xOffset"
    .parameter "yOffset"
    .parameter "dragInfo"

    .prologue
    const/4 v7, 0x1

    .line 68
    move-object v0, p6

    check-cast v0, Lorg/zeam/ItemInfo;

    move-object v1, v0

    .line 69
    .local v1, itemInfo:Lorg/zeam/ItemInfo;
    iget v2, v1, Lorg/zeam/ItemInfo;->itemType:I

    .line 71
    .local v2, itemType:I
    if-eqz v2, :cond_0

    .line 72
    if-ne v2, v7, :cond_1

    .line 73
    :cond_0
    iget-wide v3, v1, Lorg/zeam/ItemInfo;->container:J

    iget-object v5, p0, Lorg/zeam/FolderIcon;->mInfo:Lorg/zeam/UserFolderInfo;

    iget-wide v5, v5, Lorg/zeam/UserFolderInfo;->id:J

    cmp-long v3, v3, v5

    if-eqz v3, :cond_1

    move v3, v7

    :goto_0
    return v3

    :cond_1
    const/4 v3, 0x0

    .line 71
    goto :goto_0
.end method

.method public estimateDropLocation(Lorg/zeam/DragSource;IIIILjava/lang/Object;Landroid/graphics/Rect;)Landroid/graphics/Rect;
    .locals 1
    .parameter "source"
    .parameter "x"
    .parameter "y"
    .parameter "xOffset"
    .parameter "yOffset"
    .parameter "dragInfo"
    .parameter "recycle"

    .prologue
    .line 82
    const/4 v0, 0x0

    return-object v0
.end method

.method public onDragEnter(Lorg/zeam/DragSource;IIIILjava/lang/Object;)V
    .locals 2
    .parameter "source"
    .parameter "x"
    .parameter "y"
    .parameter "xOffset"
    .parameter "yOffset"
    .parameter "dragInfo"

    .prologue
    const/4 v1, 0x0

    .line 102
    iget-object v0, p0, Lorg/zeam/FolderIcon;->mOpenIcon:Landroid/graphics/drawable/Drawable;

    invoke-virtual {p0, v1, v0, v1, v1}, Lorg/zeam/FolderIcon;->setCompoundDrawablesWithIntrinsicBounds(Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V

    .line 103
    return-void
.end method

.method public onDragExit(Lorg/zeam/DragSource;IIIILjava/lang/Object;)V
    .locals 2
    .parameter "source"
    .parameter "x"
    .parameter "y"
    .parameter "xOffset"
    .parameter "yOffset"
    .parameter "dragInfo"

    .prologue
    const/4 v1, 0x0

    .line 118
    iget-object v0, p0, Lorg/zeam/FolderIcon;->mCloseIcon:Landroid/graphics/drawable/Drawable;

    invoke-virtual {p0, v1, v0, v1, v1}, Lorg/zeam/FolderIcon;->setCompoundDrawablesWithIntrinsicBounds(Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;Landroid/graphics/drawable/Drawable;)V

    .line 119
    return-void
.end method

.method public onDragOver(Lorg/zeam/DragSource;IIIILjava/lang/Object;)V
    .locals 0
    .parameter "source"
    .parameter "x"
    .parameter "y"
    .parameter "xOffset"
    .parameter "yOffset"
    .parameter "dragInfo"

    .prologue
    .line 110
    return-void
.end method

.method public onDrop(Lorg/zeam/DragSource;IIIILjava/lang/Object;)V
    .locals 8
    .parameter "source"
    .parameter "x"
    .parameter "y"
    .parameter "xOffset"
    .parameter "yOffset"
    .parameter "dragInfo"

    .prologue
    const/4 v5, 0x0

    .line 91
    move-object v0, p6

    check-cast v0, Lorg/zeam/ApplicationItemInfo;

    move-object v2, v0

    .line 92
    .local v2, item:Lorg/zeam/ApplicationItemInfo;
    iget-object v1, p0, Lorg/zeam/FolderIcon;->mInfo:Lorg/zeam/UserFolderInfo;

    invoke-virtual {v1, v2}, Lorg/zeam/UserFolderInfo;->add(Lorg/zeam/ApplicationItemInfo;)V

    .line 93
    iget-object v1, p0, Lorg/zeam/FolderIcon;->mLauncher:Lorg/zeam/Launcher;

    iget-object v3, p0, Lorg/zeam/FolderIcon;->mInfo:Lorg/zeam/UserFolderInfo;

    iget-wide v3, v3, Lorg/zeam/UserFolderInfo;->id:J

    move v6, v5

    move v7, v5

    invoke-static/range {v1 .. v7}, Lorg/zeam/LauncherModel;->addOrMoveItemInDatabase(Landroid/content/Context;Lorg/zeam/ItemInfo;JIII)V

    .line 94
    return-void
.end method
